/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_cheikeuraffectationbesoin")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvCheikeuraffectationbesoin.findAll", query = "SELECT c FROM CvCheikeuraffectationbesoin c"),
    @NamedQuery(name = "CvCheikeuraffectationbesoin.findByIdCkeik", query = "SELECT c FROM CvCheikeuraffectationbesoin c WHERE c.idCkeik = :idCkeik"),
    @NamedQuery(name = "CvCheikeuraffectationbesoin.findByIdAffectation", query = "SELECT c FROM CvCheikeuraffectationbesoin c WHERE c.idAffectation = :idAffectation"),
    @NamedQuery(name = "CvCheikeuraffectationbesoin.findByCkeckradio", query = "SELECT c FROM CvCheikeuraffectationbesoin c WHERE c.ckeckradio = :ckeckradio"),
    @NamedQuery(name = "CvCheikeuraffectationbesoin.findByLieu", query = "SELECT c FROM CvCheikeuraffectationbesoin c WHERE c.lieu = :lieu")})
public class CvCheikeuraffectationbesoin implements Serializable {
    @JoinColumn(name = "id_affectation", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private CvAffectationbesoin idAffectation;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_ckeik")
    private Integer idCkeik;
    @Basic(optional = false)
    @Column(name = "ckeckradio")
    @Temporal(TemporalType.TIME)
    private Date ckeckradio;
    @Basic(optional = false)
    @Column(name = "Lieu")
    private String lieu;

    public CvCheikeuraffectationbesoin() {
    }

    public CvCheikeuraffectationbesoin(Integer idCkeik) {
        this.idCkeik = idCkeik;
    }

    public CvCheikeuraffectationbesoin(Integer idCkeik, Date ckeckradio, String lieu) {
        this.idCkeik = idCkeik;
        this.ckeckradio = ckeckradio;
        this.lieu = lieu;
    }

    public Integer getIdCkeik() {
        return idCkeik;
    }

    public void setIdCkeik(Integer idCkeik) {
        this.idCkeik = idCkeik;
    }


    public Date getCkeckradio() {
        return ckeckradio;
    }

    public void setCkeckradio(Date ckeckradio) {
        this.ckeckradio = ckeckradio;
    }

    public String getLieu() {
        return lieu;
    }

    public void setLieu(String lieu) {
        this.lieu = lieu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCkeik != null ? idCkeik.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvCheikeuraffectationbesoin)) {
            return false;
        }
        CvCheikeuraffectationbesoin other = (CvCheikeuraffectationbesoin) object;
        if ((this.idCkeik == null && other.idCkeik != null) || (this.idCkeik != null && !this.idCkeik.equals(other.idCkeik))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvCheikeuraffectationbesoin[ idCkeik=" + idCkeik + " ]";
    }

    public CvAffectationbesoin getIdAffectation() {
        return idAffectation;
    }

    public void setIdAffectation(CvAffectationbesoin idAffectation) {
        this.idAffectation = idAffectation;
    }
    
}
